package my.util;

import java.util.Collection;

public final class MyCollections {

	private MyCollections() {
	}

	public static <E> boolean contains(Collection<E> coll, E elem) {
		if (coll == null)
			throw new IllegalArgumentException("null collection");

		// elem may be null
		try {
			return coll.contains(elem);
		} catch (NullPointerException e) {
			return false;
		}
	}
}
